package cn.ywsj.ywsjmidtier.service.impl;

import cn.ywsj.ywsjmidtier.common.Connect;

import cn.ywsj.ywsjmidtier.entity.DTO.GoodsSearchDTO;
import cn.ywsj.ywsjmidtier.service.GoodsService;
import com.mzlion.easyokhttp.HttpClient;
import org.springframework.stereotype.Service;

/**
 * @ClassName : GoodsServiceImpl
 * @Author : Lenovo
 * @Date: 2021/7/15 16:00
 * @Description :
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    @Override
    public String queryGoodsList(GoodsSearchDTO goodsSearchDTO) {
        String url = "/buyer/goods/search";
        String goodsList = HttpClient.get(Connect.SHOP_URL+url)
                /*.param("page_no",goodsSearchDTO.getPageNo().toString())
                .param("page_size",goodsSearchDTO.getPageSize().toString())
                .param("category",goodsSearchDTO.getCategory().toString())
                .param("catId",goodsSearchDTO.getShopCatId().toString())*/
                .asString();
        return goodsList;
    }

    @Override
    public Object getGoods() {
        String url = "/buyer/goods/";
        String goods = HttpClient.get(Connect.SHOP_URL+url).asString();
        return goods;
    }
}
